/*******************************************************************************
 * Copyright (c) 2010, 2030 www.mahao.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.springboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import cn.itlaobing.springboot.entity.Student;

/** 
 * ClassName: StudentMapper <br/> 
 * Function: TODO 功能描述 <br/> 
 * date: 2017年6月7日 下午4:31:34 <br/> 
 * 
 * @author Mmmmm 
 * @version  
 * @since JDK 1.8 
 */
public interface StudentMapper {
	@Select("SELECT * FROM students")
    List<Student> findAll();

    @Select("SELECT * FROM students WHERE id = #{id}")
    Student findOne(Long id);

    @Insert("INSERT INTO students(name,age) VALUES(#{name}, #{age})")
    void save(Student stu);

    @Update("UPDATE students SET name=#{name},age=#{age} WHERE id =#{id}")
    void update(Student stu);

    @Delete("DELETE FROM students WHERE id =#{id}")
    void delete(Long id);
}
